
<template>
  <div>
    <vue-pickers :show="show"
                 :columns="columns"
                 :defaultData="defaultData"
                 :selectData="pickData"
                 @cancel="close"
                 @confirm="confirmFn"
                 :replaceData='replaceData'></vue-pickers>
  </div>
</template>
<script>
import Vue from 'vue'
import vuePickers from '@/components/picker'
export default {
  name: 'vSelect',
  components: {
    vuePickers
  },
  props: {
    show: Boolean,
    parameter: String,
    attr: String,
    defaultData: Array,
    replaceData: {
      type: Object,
      default () {
        return {}
      }
    },
    pickData: {
      type: Object,
      default: function () {
        return {
          data1: []
        }
      }
    }
  },
  data () {
    return {
      isCopy: '',
      columns: 1,
      res: null
    }
  },
  mounted () {
  },
  methods: {
    close () {
      this.$emit('closeBackData')
    },
    confirmFn (val) {
      let callBack = {}
      callBack.show = false
      callBack.items = val
      callBack.parameter = this.parameter
      callBack.attr = this.attr
      callBack.defaultData = [val.select1]
      this.$emit('callbackData', callBack)
    },
    toShow () {
      this.show = true
    }
  }
}
</script>

<style>
.btnbox {
  display: flex;
  justify-content: center;
}
.btn {
  background: #2e68fa;
  color: #fff;
  padding: 5px 10px;
  display: inline-block;
  margin: 0 10px;
  font-size: 14px;
  border-radius: 4px;
}
.result {
  text-align: center;
  padding: 10px;
}
.isCopy {
  margin: 10px;
  border: 1px dashed red;
  text-align: center;
}
</style>
